const express = require("express");
const app = express();
const router = express.Router();

const { mysql,executeQuery } = require("../../mysql");

router.post("/read-user", async (req, res) => {
  let sql = `select * from ${req.body.col} where id='${req.body.id}';`;
  try {
    let result = await executeQuery(sql);

    res.json({
      res: result,
    });

  } catch (error) {
    console.error('Error executing query:', error);
    res.status(500).send('Internal Server Error');
  }
});
module.exports = router;
